<?php
class PostFilter {

	var $Action;
	var $ActionCaption;
	var $RealtyType;
	var $SettlementRegion;
	var $SettlementCity;
	var $Street;
	var $AreaRef;
	var $Area;
	var $PriceRef;
	var $Price;
	var $Description;
	var $PersonName;
	var $eMail;
	var $ICQ;
	var $Phone;
	var $PostDate;
	var $PageNo;
	var $State;
	
	
	function PostFilter($aim_caption) {
	
		$this->ActionCaption = $aim_caption;
		
		$settings = &getService('GlobalSettings');
		$link = mysql_connect($settings->get('db_host'), $settings->get('db_username'), $settings->get('db_password'));
		mysql_select_db($settings->get('db_name'), $link) or die(mysql_error());
		
		if(Trim($aim_caption)!=''){
			$query = 'select a_id from actions where filter_caption = "' . $aim_caption . '"';
			$res = mysql_query($query) or die(mysql_error());
			while ($row=mysql_fetch_array($res)){
				$this->Action = $row["a_id"];
			}
		}
		mysql_close($link);		
		$this->PageNo = 1;
	}
}
?>